package net.lab1024.smartadmin.module.weapp.users.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import net.lab1024.smartadmin.module.system.employee.domain.dto.EmployeeDTO;
import net.lab1024.smartadmin.module.weapp.users.domain.dto.UsersAddDTO;
import net.lab1024.smartadmin.module.weapp.users.domain.dto.UsersQueryDTO;
import net.lab1024.smartadmin.module.weapp.users.domain.entity.UsersEntity;
import net.lab1024.smartadmin.module.weapp.users.domain.vo.UsersVO;
import net.lab1024.smartadmin.module.weapp.users.domain.vo.UsersExcelVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * [ 微信小程序 用户信息表 ]
 *
 * @author wuqian
 * @version 1.0
 * @company 五千
 * @copyright (c)  五千Inc. All rights reserved.
 * @date 2021-03-09 14:13:28
 * @since JDK1.8
 */
@Mapper
@Component
public interface UsersDao extends BaseMapper<UsersEntity> {

    /**
     * 分页查询
     * @param queryDTO
     * @return UsersVO
    */
    IPage<UsersVO> queryByPage(Page page, @Param("queryDTO") UsersQueryDTO queryDTO);

    /**
     * 根据id删除
     * @param id
     * @return
    */
    void deleteById(@Param("id") Long id);

    /**
     * 根据openid 查询
     * @param openid
     * @return
     */
    UsersVO selectByOpenid(@Param("openid") String openid);

    /**
     * 根据uid 查询
     * @param uid
     * @return
     */
    UsersVO selectByUid(@Param("uid") Long uid);
    /**
     * 根据id批量删除
     * @param idList
     * @return
    */
    void deleteByIdList(@Param("idList") List<Long> idList);

        /**
     * 查询所有导出数据
     * @param queryDTO
     * @return
     */
    List<UsersExcelVO> queryAllExportData(@Param("queryDTO") UsersQueryDTO queryDTO);

        /**
         * 查询批量导出数据
         * @param idList
         * @return
         */
    List<UsersExcelVO> queryBatchExportData(@Param("idList") List<Long> idList);
}
